﻿<UserControl x:Class="ExORMDesginer.UserControls.FilterDbSchemaView"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
	    xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
	    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:Converter="clr-namespace:ExtendPropertyLib.XAML.Converters;assembly=ExtendPropertyLib.WPF"
             xmlns:M="clr-namespace:ExORMDesginer.Models" mc:Ignorable="d"  Height="460" Width="680">
    <UserControl.Resources>
        <M:FilterConditionEnum x:Key="FilterConditionEnum"/>
        <Converter:EnumConverter x:Key="enumConverter" />
    </UserControl.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="23" />
            <RowDefinition Height="404*" />
            <RowDefinition Height="30" />
        </Grid.RowDefinitions>
        <StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
            <telerik:RadSplitButton Margin="0 5 0 0" Height="35" BorderThickness="0"
						VerticalAlignment="Center" Width="55" DropDownWidth="55" >
                <telerik:RadSplitButton.Content>
                    <Button Name="SelectedAll" Content="全选" FontSize="11" BorderThickness="0" Margin="0" Height="10"></Button>
                </telerik:RadSplitButton.Content>
                <telerik:RadSplitButton.DropDownContent>
                    <StackPanel Background="Transparent">
                        <Button Name="SelectedActivePage" BorderThickness="0" Content="当前Tab" Height="18" Margin="0.5"/>
                        <Button Name="SelectedAllPage" Content="所有Tab" BorderThickness="0" Height="18" Margin="0.5"/>
                    </StackPanel>
                </telerik:RadSplitButton.DropDownContent>
            </telerik:RadSplitButton>
            <telerik:RadSplitButton Margin="6 5 0 0" Height="35" BorderThickness="0"
						VerticalAlignment="Center" Width="55" DropDownWidth="55" >
                <telerik:RadSplitButton.Content>
                    <Button Name="UnSelectedAll" Content="取消" FontSize="11" BorderThickness="0" Margin="0" Height="10"></Button>
                </telerik:RadSplitButton.Content>
                <telerik:RadSplitButton.DropDownContent>
                    <StackPanel  Background="Transparent">
                        <Button Name="UnSelectedActivePage" Content="当前Tab" BorderThickness="0" Height="18" Margin="0.5"/>
                        <Button Name="UnSelectedAllPage" Content="所有Tab" BorderThickness="0" Height="18" Margin="0.5"/>
                    </StackPanel>
                </telerik:RadSplitButton.DropDownContent>
            </telerik:RadSplitButton>
            <telerik:RadSplitButton Content="条件" Margin="6 5 5 0" Height="35" BorderThickness="0" FontSize="11" Foreground="Azure"
						VerticalAlignment="Center" Width="50" DropDownWidth="350" >
                <telerik:RadSplitButton.DropDownContent>
                    <StackPanel Orientation="Horizontal" Background="#FF252525" Height="30">
                        <TextBlock Text="条件:" VerticalAlignment="Center" Foreground="Azure" Margin="5,0,0,0"/>
                        <ComboBox ItemsSource="{Binding Source={StaticResource FilterConditionEnum},Converter={StaticResource enumConverter}}" SelectedItem="{Binding Model.Condition}" Width="80"  Height="20" Margin="5,0,0,0"/>
                        <TextBlock Text="名称:" VerticalAlignment="Center" Foreground="Azure" Margin="5,0,0,0"/>
                        <TextBox Text="{Binding Model.ConditionText}" Width="80" Height="20" Margin="5,0,0,0"/>
                        <Button Name="ConditionSelect" Width="50" Height="15" Content="选择" Margin="5,0,0,0"/>
                        <Button Name="ConditionUnSelect" Width="50" Height="20" Content="取消" Margin="5,0,0,0"/>
                    </StackPanel>
                </telerik:RadSplitButton.DropDownContent>
            </telerik:RadSplitButton>
        </StackPanel>
        <TabControl Grid.Row="1">
            <TabItem Header="数据表" IsSelected="{Binding Model.IsTable}">
                <ListView ItemsSource="{Binding Model.SelectedTableItems}">
                    <ListView.View>
                        <GridView>
                            <GridViewColumn Width="50" >
                                <GridViewColumn.CellTemplate>
                                    <DataTemplate>
                                        <CheckBox IsChecked="{Binding IsCheck}"  ToolTip="{Binding Item.Description}" VerticalAlignment="Center">
                                        </CheckBox>
                                    </DataTemplate>
                                </GridViewColumn.CellTemplate>
                            </GridViewColumn>
                            <GridViewColumn Width="280" Header="名称"  DisplayMemberBinding="{Binding Item.Name}"/>
                            <GridViewColumn Width="320"  Header="说明" DisplayMemberBinding="{Binding Item.Description}" />
                        </GridView>
                    </ListView.View>
                </ListView>
            </TabItem>
            <TabItem Header="视图" IsSelected="{Binding Model.IsView}">
                <ListView ItemsSource="{Binding Model.SelectedViewItems}">
                    <ListView.View>
                        <GridView>
                            <GridViewColumn Width="50" >
                                <GridViewColumn.CellTemplate>
                                    <DataTemplate>
                                        <CheckBox IsChecked="{Binding IsCheck}"  ToolTip="{Binding Item.Description}" VerticalAlignment="Center">
                                        </CheckBox>
                                    </DataTemplate>
                                </GridViewColumn.CellTemplate>
                            </GridViewColumn>
                            <GridViewColumn Width="280" Header="名称"  DisplayMemberBinding="{Binding Item.Name}"/>
                            <GridViewColumn Width="320"  Header="说明" DisplayMemberBinding="{Binding Item.Description}" />
                        </GridView>
                    </ListView.View>
                </ListView>
            </TabItem>
            <TabItem Header="存储过程" IsSelected="{Binding Model.IsSp}" >
                <ListView ItemsSource="{Binding Model.SelectedSpItems}">
                    <ListView.View>
                        <GridView>
                            <GridViewColumn Width="50" >
                                <GridViewColumn.CellTemplate>
                                    <DataTemplate>
                                        <CheckBox IsChecked="{Binding IsCheck}"  ToolTip="{Binding Item.Description}" VerticalAlignment="Center">
                                        </CheckBox>
                                    </DataTemplate>
                                </GridViewColumn.CellTemplate>
                            </GridViewColumn>
                            <GridViewColumn Width="280" Header="名称"  DisplayMemberBinding="{Binding Item.Name}"/>
                            <GridViewColumn Width="320"  Header="说明" DisplayMemberBinding="{Binding Item.Description}" />
                        </GridView>
                    </ListView.View>
                </ListView>
            </TabItem>
        </TabControl>
        
        <StackPanel Orientation="Horizontal" Grid.Row="2" HorizontalAlignment="Right" Margin="0,0,10,0">
            <Button Name="Sync" Content="同步" Height="23"  Width="82" />
            
        </StackPanel>
        
        
    </Grid>
</UserControl>
